--------------------------------------------------------
--  File created - Friday-May-11-2012   
--------------------------------------------------------
--------------------------------------------------------
--  DDL for Sequence ADOTTVALASZ_SQ
--------------------------------------------------------

   CREATE SEQUENCE  "ADOTTVALASZ_SQ"  MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER  NOCYCLE ;
/
--------------------------------------------------------
--  DDL for Sequence KERDESVALASZ_SQ
--------------------------------------------------------

   CREATE SEQUENCE  "KERDESVALASZ_SQ"  MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER  NOCYCLE ;
/
--------------------------------------------------------
--  DDL for Sequence ROSSZVALASZ_SQ
--------------------------------------------------------

   CREATE SEQUENCE  "ROSSZVALASZ_SQ"  MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER  NOCYCLE ;
/
--------------------------------------------------------
--  DDL for Sequence TEMAKOR_SQ
--------------------------------------------------------

   CREATE SEQUENCE  "TEMAKOR_SQ"  MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER  NOCYCLE ;
/
--------------------------------------------------------
--  DDL for Table ADOTTVALASZ
--------------------------------------------------------

  CREATE TABLE "ADOTTVALASZ" 
   (	"ADOTTV_AZ" NUMBER, 
	"FELHASZNEV" VARCHAR2(30 BYTE), 
	"KERDES_AZ" NUMBER, 
	"HELYES_HELYTELEN" NUMBER, 
	"IDO" TIMESTAMP (6)
   ) ;
/
--------------------------------------------------------
--  DDL for Table FELHASZNALOK
--------------------------------------------------------

  CREATE TABLE "FELHASZNALOK" 
   (	"FELHASZNEV" VARCHAR2(30 BYTE), 
	"JELSZO" VARCHAR2(32 BYTE), 
	"EMAIL" VARCHAR2(30 BYTE), 
	"VALODI_NEV" VARCHAR2(30 BYTE), 
	"IRSZAM" NUMBER, 
	"LAKCIM" VARCHAR2(30 BYTE), 
	"KOR" NUMBER, 
	"NEM" NUMBER, 
	"OKTATASI_SZINT_AZ" NUMBER, 
	"JOGOSULTSAG" NUMBER, 
	"PONTSZAM" NUMBER
   ) ;
/
--------------------------------------------------------
--  DDL for Table IRSZAMVAROS
--------------------------------------------------------

  CREATE TABLE "IRSZAMVAROS" 
   (	"IRSZAM" NUMBER, 
	"TELEPULES_NEV" VARCHAR2(30 BYTE)
   ) ;
/
--------------------------------------------------------
--  DDL for Table KERDESTEMAKOR
--------------------------------------------------------

  CREATE TABLE "KERDESTEMAKOR" 
   (	"KERDES_AZ" NUMBER, 
	"TEMAKOR_AZ" NUMBER
   ) ;
/
--------------------------------------------------------
--  DDL for Table KERDESVALASZ
--------------------------------------------------------

  CREATE TABLE "KERDESVALASZ" 
   (	"KERDES_AZ" NUMBER, 
	"KERDES" VARCHAR2(30 BYTE), 
	"VALASZ" VARCHAR2(30 BYTE), 
	"NEHEZSEGI_SZINT" NUMBER
   ) ;
/
--------------------------------------------------------
--  DDL for Table OKTATSZINT
--------------------------------------------------------

  CREATE TABLE "OKTATSZINT" 
   (	"OKTSZ_AZ" NUMBER, 
	"OKTSZ_NEV" VARCHAR2(30 BYTE)
   ) ;
/
--------------------------------------------------------
--  DDL for Table ROSSZVALASZ
--------------------------------------------------------

  CREATE TABLE "ROSSZVALASZ" 
   (	"RVALASZ_AZ" NUMBER, 
	"KERDES_AZ" NUMBER, 
	"ROSSZ_VALASZ" VARCHAR2(30 BYTE)
   ) ;
/
--------------------------------------------------------
--  DDL for Table TEMAKOR
--------------------------------------------------------

  CREATE TABLE "TEMAKOR" 
   (	"TEMAKOR_AZ" NUMBER, 
	"TEMAKOR_NEV" VARCHAR2(30 BYTE)
   ) ;
/
--------------------------------------------------------
--  DDL for Index FELHASZNALOK_PK
--------------------------------------------------------

  CREATE UNIQUE INDEX "FELHASZNALOK_PK" ON "FELHASZNALOK" ("FELHASZNEV") 
  ;
/
--------------------------------------------------------
--  DDL for Index KERDESTEMAKOR_PK
--------------------------------------------------------

  CREATE UNIQUE INDEX "KERDESTEMAKOR_PK" ON "KERDESTEMAKOR" ("KERDES_AZ", "TEMAKOR_AZ") 
  ;
/
--------------------------------------------------------
--  DDL for Index OKTATSZINT_PK
--------------------------------------------------------

  CREATE UNIQUE INDEX "OKTATSZINT_PK" ON "OKTATSZINT" ("OKTSZ_AZ") 
  ;
/
--------------------------------------------------------
--  DDL for Index ROSSZVALASZ_PK
--------------------------------------------------------

  CREATE UNIQUE INDEX "ROSSZVALASZ_PK" ON "ROSSZVALASZ" ("RVALASZ_AZ") 
  ;
/
--------------------------------------------------------
--  DDL for Index TEMAKOR_PK
--------------------------------------------------------

  CREATE UNIQUE INDEX "TEMAKOR_PK" ON "TEMAKOR" ("TEMAKOR_AZ") 
  ;
/
--------------------------------------------------------
--  DDL for Index KERDESVALASZ_PK
--------------------------------------------------------

  CREATE UNIQUE INDEX "KERDESVALASZ_PK" ON "KERDESVALASZ" ("KERDES_AZ") 
  ;
/
--------------------------------------------------------
--  DDL for Index ADOTTVALASZ_PK
--------------------------------------------------------

  CREATE UNIQUE INDEX "ADOTTVALASZ_PK" ON "ADOTTVALASZ" ("ADOTTV_AZ") 
  ;
/
--------------------------------------------------------
--  DDL for Index IRSZAMVAROS_PK
--------------------------------------------------------

  CREATE UNIQUE INDEX "IRSZAMVAROS_PK" ON "IRSZAMVAROS" ("IRSZAM") 
  ;
/
--------------------------------------------------------
--  Constraints for Table OKTATSZINT
--------------------------------------------------------

  ALTER TABLE "OKTATSZINT" MODIFY ("OKTSZ_AZ" NOT NULL ENABLE);
  ALTER TABLE "OKTATSZINT" MODIFY ("OKTSZ_NEV" NOT NULL ENABLE);
  ALTER TABLE "OKTATSZINT" ADD CONSTRAINT "OKTATSZINT_PK" PRIMARY KEY ("OKTSZ_AZ") ENABLE;
/
--------------------------------------------------------
--  Constraints for Table TEMAKOR
--------------------------------------------------------

  ALTER TABLE "TEMAKOR" MODIFY ("TEMAKOR_AZ" NOT NULL ENABLE);
  ALTER TABLE "TEMAKOR" MODIFY ("TEMAKOR_NEV" NOT NULL ENABLE);
  ALTER TABLE "TEMAKOR" ADD CONSTRAINT "TEMAKOR_PK" PRIMARY KEY ("TEMAKOR_AZ") ENABLE;
/
--------------------------------------------------------
--  Constraints for Table IRSZAMVAROS
--------------------------------------------------------

  ALTER TABLE "IRSZAMVAROS" MODIFY ("IRSZAM" NOT NULL ENABLE);
  ALTER TABLE "IRSZAMVAROS" MODIFY ("TELEPULES_NEV" NOT NULL ENABLE);
  ALTER TABLE "IRSZAMVAROS" ADD CONSTRAINT "IRSZAMVAROS_PK" PRIMARY KEY ("IRSZAM") ENABLE;
/
--------------------------------------------------------
--  Constraints for Table ADOTTVALASZ
--------------------------------------------------------

  ALTER TABLE "ADOTTVALASZ" MODIFY ("ADOTTV_AZ" NOT NULL ENABLE);
  ALTER TABLE "ADOTTVALASZ" MODIFY ("FELHASZNEV" NOT NULL ENABLE);
  ALTER TABLE "ADOTTVALASZ" MODIFY ("KERDES_AZ" NOT NULL ENABLE);
  ALTER TABLE "ADOTTVALASZ" MODIFY ("HELYES_HELYTELEN" NOT NULL ENABLE);
  ALTER TABLE "ADOTTVALASZ" MODIFY ("IDO" NOT NULL ENABLE);
  ALTER TABLE "ADOTTVALASZ" ADD CONSTRAINT "ADOTTVALASZ_PK" PRIMARY KEY ("ADOTTV_AZ") ENABLE;
/
--------------------------------------------------------
--  Constraints for Table KERDESVALASZ
--------------------------------------------------------

  ALTER TABLE "KERDESVALASZ" MODIFY ("KERDES_AZ" NOT NULL ENABLE);
  ALTER TABLE "KERDESVALASZ" ADD CONSTRAINT "KERDESVALASZ_PK" PRIMARY KEY ("KERDES_AZ") ENABLE;
/
--------------------------------------------------------
--  Constraints for Table ROSSZVALASZ
--------------------------------------------------------

  ALTER TABLE "ROSSZVALASZ" MODIFY ("RVALASZ_AZ" NOT NULL ENABLE);
  ALTER TABLE "ROSSZVALASZ" MODIFY ("KERDES_AZ" NOT NULL ENABLE);
  ALTER TABLE "ROSSZVALASZ" MODIFY ("ROSSZ_VALASZ" NOT NULL ENABLE);
  ALTER TABLE "ROSSZVALASZ" ADD CONSTRAINT "ROSSZVALASZ_PK" PRIMARY KEY ("RVALASZ_AZ") ENABLE;
/
--------------------------------------------------------
--  Constraints for Table FELHASZNALOK
--------------------------------------------------------

  ALTER TABLE "FELHASZNALOK" MODIFY ("FELHASZNEV" NOT NULL ENABLE);
  ALTER TABLE "FELHASZNALOK" MODIFY ("JELSZO" NOT NULL ENABLE);
  ALTER TABLE "FELHASZNALOK" MODIFY ("EMAIL" NOT NULL ENABLE);
  ALTER TABLE "FELHASZNALOK" MODIFY ("VALODI_NEV" NOT NULL ENABLE);
  ALTER TABLE "FELHASZNALOK" MODIFY ("KOR" NOT NULL ENABLE);
  ALTER TABLE "FELHASZNALOK" ADD CONSTRAINT "FELHASZNALOK_PK" PRIMARY KEY ("FELHASZNEV") ENABLE;
/
--------------------------------------------------------
--  Constraints for Table KERDESTEMAKOR
--------------------------------------------------------

  ALTER TABLE "KERDESTEMAKOR" MODIFY ("KERDES_AZ" NOT NULL ENABLE);
  ALTER TABLE "KERDESTEMAKOR" MODIFY ("TEMAKOR_AZ" NOT NULL ENABLE);
  ALTER TABLE "KERDESTEMAKOR" ADD CONSTRAINT "KERDESTEMAKOR_PK" PRIMARY KEY ("KERDES_AZ", "TEMAKOR_AZ") ENABLE;
/
--------------------------------------------------------
--  Ref Constraints for Table ADOTTVALASZ
--------------------------------------------------------

  ALTER TABLE "ADOTTVALASZ" ADD CONSTRAINT "ADOTTVALASZ_FELHASZNALOK_FK1" FOREIGN KEY ("FELHASZNEV")
	  REFERENCES "FELHASZNALOK" ("FELHASZNEV") ON DELETE CASCADE ENABLE;
  ALTER TABLE "ADOTTVALASZ" ADD CONSTRAINT "ADOTTVALASZ_KERDESVALASZ_FK1" FOREIGN KEY ("KERDES_AZ")
	  REFERENCES "KERDESVALASZ" ("KERDES_AZ") ON DELETE CASCADE ENABLE;
/
--------------------------------------------------------
--  Ref Constraints for Table FELHASZNALOK
--------------------------------------------------------

  ALTER TABLE "FELHASZNALOK" ADD CONSTRAINT "FELHASZNALOK_IRSZAMVAROS_FK1" FOREIGN KEY ("IRSZAM")
	  REFERENCES "IRSZAMVAROS" ("IRSZAM") ON DELETE CASCADE ENABLE;
  ALTER TABLE "FELHASZNALOK" ADD CONSTRAINT "FELHASZNALOK_OKTATSZINT_FK1" FOREIGN KEY ("OKTATASI_SZINT_AZ")
	  REFERENCES "OKTATSZINT" ("OKTSZ_AZ") ON DELETE CASCADE ENABLE;
/

--------------------------------------------------------
--  Ref Constraints for Table KERDESTEMAKOR
--------------------------------------------------------

  ALTER TABLE "KERDESTEMAKOR" ADD CONSTRAINT "KERDESTEMAKOR_KERDESVALAS_FK1" FOREIGN KEY ("KERDES_AZ")
	  REFERENCES "KERDESVALASZ" ("KERDES_AZ") ON DELETE CASCADE ENABLE;
  ALTER TABLE "KERDESTEMAKOR" ADD CONSTRAINT "KERDESTEMAKOR_TEMAKOR_FK1" FOREIGN KEY ("TEMAKOR_AZ")
	  REFERENCES "TEMAKOR" ("TEMAKOR_AZ") ON DELETE CASCADE ENABLE;
/


--------------------------------------------------------
--  Ref Constraints for Table ROSSZVALASZ
--------------------------------------------------------

  ALTER TABLE "ROSSZVALASZ" ADD CONSTRAINT "ROSSZVALASZ_KERDESVALASZ_FK1" FOREIGN KEY ("KERDES_AZ")
	  REFERENCES "KERDESVALASZ" ("KERDES_AZ") ON DELETE CASCADE ENABLE;
/

--------------------------------------------------------
--  DDL for Trigger AUTO_INC_ADOTTVALASZ
--------------------------------------------------------

  CREATE OR REPLACE TRIGGER "AUTO_INC_ADOTTVALASZ" 
before insert on adottvalasz
for each row
begin
  select adottvalasz_sq.nextval into :new.adottv_az from dual;
 end;
/
ALTER TRIGGER "AUTO_INC_ADOTTVALASZ" ENABLE;
/
--------------------------------------------------------
--  DDL for Trigger AUTO_INC_KERDESVALASZ
--------------------------------------------------------

  CREATE OR REPLACE TRIGGER "AUTO_INC_KERDESVALASZ" 
before insert on kerdesvalasz
for each row
begin
  select kerdesvalasz_sq.nextval into :new.kerdes_az from dual;
end;
/
ALTER TRIGGER "AUTO_INC_KERDESVALASZ" ENABLE;
/
--------------------------------------------------------
--  DDL for Trigger AUTO_INC_ROSSZVALASZ
--------------------------------------------------------

  CREATE OR REPLACE TRIGGER "AUTO_INC_ROSSZVALASZ" 
before insert on rosszvalasz
for each row
begin
  select rosszvalasz_sq.nextval into :new.rvalasz_az from dual;
end;
/
ALTER TRIGGER "AUTO_INC_ROSSZVALASZ" ENABLE;
/
--------------------------------------------------------
--  DDL for Trigger AUTO_INC_TEMAKOR
--------------------------------------------------------

  CREATE OR REPLACE TRIGGER "AUTO_INC_TEMAKOR" 
before insert on temakor
for each row
begin
  select temakor_sq.nextval into :new.temakor_az from dual;
end;
/
ALTER TRIGGER "AUTO_INC_TEMAKOR" ENABLE;
/
--------------------------------------------------------
--  DDL for Trigger AVALASZ_IDO
--------------------------------------------------------

  CREATE OR REPLACE TRIGGER "AVALASZ_IDO" 
before insert on adottvalasz
for each row
begin
  select CURRENT_TIMESTAMP into :new.ido from dual;
end;
/
ALTER TRIGGER "AVALASZ_IDO" ENABLE;
/

